(in-package :iorek)

(defun %define-operator (symbol precedence)
  (setf (fset:@ (symbol-properties symbol) *symbol-lang-operator-precedence*) precedence))

(defun operator-p (symbol)
  (and (symbol-p symbol)
       (fset:@ (symbol-properties symbol) *symbol-lang-operator-precedence*)))

(defun operator? (symbol)
  (or (operator-p symbol) *symbol-lang-false*))

(defun operator-precedence (symbol)
  (fset:@ (symbol-properties symbol) *symbol-lang-operator-precedence*))

(%define-operator *symbol-lang-\|* 1)
(%define-operator *symbol-lang-\|\|* 1)
(%define-operator *symbol-lang-\|\|\|* 1)
(%define-operator *symbol-lang-\|\|\|\|* 1)

(%define-operator *symbol-lang-+* 100)
(%define-operator *symbol-lang--* 100)
(%define-operator *symbol-lang-** 200)
(%define-operator *symbol-lang-/* 200)